#include<bits/stdc++.h>
using namespace std;
int n,a,sum,b[100005],cl,maxn;
struct node{
	int s1,s2,ci;
}c[100005];
bool cmp(node a,node b){
	return a.s1<b.s1;
}
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin>>n;
	sum=n;
	for(int i=1;i<=n;i++) cin>>a,b[a]++,maxn=max(maxn,a);
	for(int i=1;i<=maxn;i++){
		if(b[i]>0) c[++cl].s1=i,c[cl].s2=b[i],c[cl].ci=b[i];
	}
	sort(c+1,c+cl+1,cmp);
	for(int i=1;i<=cl;i++){
		if(c[i].ci<1) continue;
		int j=i-1;
		while(j>0&&c[i].ci>0){
			if(c[j].s2<1){
				while(c[j].s2<1&&j>0){
					j--;
				}		
			}
			if(j<1) break;
			c[i].ci--;
			c[j].s2--;
			c[j].ci--;
			sum--;
		}
	}
	cout<<sum;
	return 0;
}
